﻿<UserControl x:Class="TheJoyOfCode.SLUploader.FileUploader"
        xmlns="http://schemas.microsoft.com/client/2007" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:SLUploader="clr-namespace:TheJoyOfCode.SLUploader" 
        xmlns:System="clr-namespace:System;assembly=mscorlib"  >
    <UserControl.Resources>
        <SLUploader:BoolToVisibilityConverter x:Key="boolToVisibility" Mode="TrueEqualsVisible" />
    </UserControl.Resources>
    <Grid x:Name="_rootGrid">
    	<Border x:Name="_border" BorderBrush="Black" BorderThickness="1" CornerRadius="5" Grid.ColumnSpan="2">
    		<Border.Background>
    			<LinearGradientBrush EndPoint="0.497999995946884,0" StartPoint="0.501999974250793,1">
    				<GradientStop Color="#FE3E3C4E" Offset="0"/>
    				<GradientStop Color="#FEADA8D9" Offset="1"/>
    			</LinearGradientBrush>
    		</Border.Background>
    		<Border x:Name="_track" BorderBrush="Black" BorderThickness="1" Margin="5" CornerRadius="2,2,2,2">
                <ProgressBar x:Name="_progress" Minimum="0" Value="{Binding UploadedFiles}" Maximum="{Binding TotalFiles}" BorderThickness="0" >
                    <ProgressBar.Template>
                        <ControlTemplate TargetType="ProgressBar">
                            <Border x:Name="ProgressBarTrack">
                                <!--<Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF4C496A" Offset="0.04"/>
                                        <GradientStop Color="#FF8C87B3" Offset="0.982"/>
                                        <GradientStop Color="#FF807CA1" Offset="0.49599999189376831"/>
                                        <GradientStop Color="#FF1C1B28" Offset="0"/>
                                    </LinearGradientBrush>
                                </Border.Background>-->
                                <Border x:Name="ProgressBarIndicator" HorizontalAlignment="Left">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF530041" Offset="0.504"/>
                                            <GradientStop Color="#FFCDB3E2" Offset="0"/>
                                            <GradientStop Color="#FFE200FF" Offset="0.076"/>
                                            <GradientStop Color="#FF9000A2" Offset="0.277"/>
                                            <GradientStop Color="#FF680076" Offset="0.5"/>
                                            <GradientStop Color="#FF280266" Offset="0.96"/>
                                            <GradientStop Color="#FF0B001E" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Border>
                        </ControlTemplate>
                    </ProgressBar.Template>
                </ProgressBar>
            </Border>
    	</Border>
        <TextBlock Margin="15,0,15,0"  HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Normal" Foreground="#F000" Text="{Binding Status}">
            <TextBlock.RenderTransform>
                <TranslateTransform X="1" Y="1"/>
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock Margin="15,0,15,0"  HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Normal" Foreground="#FFFF" Text="{Binding Status}" />
        <Button x:Name="_btnOK" Content="OK" Click="_btnOK_Click" Margin="8" FontSize="13" HorizontalAlignment="Right" Padding="20,0,20,0" Visibility="{Binding ShowOKButton, Converter={StaticResource boolToVisibility}}" />
        <Button x:Name="_btnUpload" Content="Upload" Click="_btnUpload_Click"  Margin="7" FontSize="20" Visibility="{Binding ShowUploadButton, Converter={StaticResource boolToVisibility}}" />
    </Grid>
</UserControl>
